package com.dd.stack.file.service.internal.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dd.stack.file.mapper.file.excel.ProductMapper;
import com.dd.stack.file.pojo.DO.ExcelProductDO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author liuxianmeng
 * @CreateTime 2024/10/23 0:11
 * @Description 类功能作用说明
 */
@Service
@RequiredArgsConstructor
public class ProductServiceImpl extends ServiceImpl<ProductMapper, ExcelProductDO> {

    private final ProductMapper pm;

    public void saveProduct(ExcelProductDO productDO) {
        pm.insert(productDO);
    }

    public List<ExcelProductDO> getAllProducts() {
        // 实际从数据库获取所有产品数据的逻辑
        return pm.selectList(null);
    }

    public List<ExcelProductDO> list(QueryWrapper<ExcelProductDO> queryWrapper) {
        return pm.selectList(queryWrapper);
    }
}
